#ifndef EVENTDISPATCHER_H
#define EVENTDISPATCHER_H

#include <XnCppWrapper.h>
#include <XnVNite.h>

#include "../Model/System.h"
#include "../View/graphicEngine.h"
#include "../Model/AppList.h"

#define XML_CONFIG_FILE "./Sample-Tracking.xml"

void XN_CALLBACK_TYPE SessionStart(const XnPoint3D& pFocus, void* UserCxt);
void XN_CALLBACK_TYPE SessionEnd(void* UserCxt);
void XN_CALLBACK_TYPE OnSwipeLeftCB(XnFloat fVelocity, XnFloat fAngle,
    void *pUserCxt);
void XN_CALLBACK_TYPE OnSwipeRightCB(XnFloat fVelocity, XnFloat fAngle,
    void *pUserCxt);

class EventDispatcher {
public:
  EventDispatcher(System * sys, GraphicEngine * ge, AppList * list);
  void startObserver();
  ~EventDispatcher();
private:
  xn::Context _context;
  XnVSessionManager* _sessionManager;
  XnVSwipeDetector _swipeD;
  XnStatus _nRetVal;
};

#endif
